UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kEexHsIEJ0b0XA/JzI+j4fI+EOYLFTIA9jrfS5/z46A='
WHERE
key_id = '837b48521095637473cb23994837460437a7c3a49e63ccafc96540fc86b73117'
AND (
token = 'kEexHsIEJ0b0XA/JzI+j4fI+EOYLFTIA9jrfS5/z46A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)