UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ALowbSL1gQtoM6iWYhoPTtKnsDPmwbh0CibpDC50piA='
WHERE
key_id = '920415952af60de92096d392da6db43bd87a3e78980a9a8dbda4db08674a9fb3'
AND (
token = 'ALowbSL1gQtoM6iWYhoPTtKnsDPmwbh0CibpDC50piA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)