UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+i4AGjzx1vCqUNxyr7lq2eJD5HAwbA8i92Q0WeUoKMs='
WHERE
key_id = '14916475c993dd4782e9c596718935be62a05ea0c0ff48755da7b66743ec5110'
AND (
token = '+i4AGjzx1vCqUNxyr7lq2eJD5HAwbA8i92Q0WeUoKMs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)