UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '44khw5HmDG3cznOEkKfrVf4u+YigfRJdVVfo3IG9rQ4='
WHERE
key_id = 'eb30879c516e3505b3880c160a275c0c7dcb1c6129e895863d53e0949c11e945'
AND (
token = '44khw5HmDG3cznOEkKfrVf4u+YigfRJdVVfo3IG9rQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)