UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TbG/5wXpAr+yW2aT47dyaoamapEwsxtiZJhDVM5JDlg='
WHERE
key_id = 'eca0669a0e3fea7cdbc124ec769d8aac0e05e99aa4fea56f80a9401c23af1bcf'
AND (
token = 'TbG/5wXpAr+yW2aT47dyaoamapEwsxtiZJhDVM5JDlg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)