UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k4mPMwe3HcJfOpVtDuIlZUAzigbiiPZkf4Axi1NZjsk='
WHERE
key_id = '0c02080a02460197ed195621959c33f7f5a55c4ac1e275cde99a5b07c0bab6fd'
AND (
token = 'k4mPMwe3HcJfOpVtDuIlZUAzigbiiPZkf4Axi1NZjsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)