UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AbBGziR4vXfWaE8GL4/mvcSmjH7b78YSmvbmUxBJCuk='
WHERE
key_id = '044feb7b5171aac10d77cf5febfea9dfb1da1b80738931edfdfa2366962d7f53'
AND (
token = 'AbBGziR4vXfWaE8GL4/mvcSmjH7b78YSmvbmUxBJCuk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)