UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f/dyzFCIDQig7Rz0Rj+nujHILcKmUH85m3DElfLpaEA='
WHERE
key_id = '25111588c01a53ccacefcf94a45a8972daf60bbf60c6241c8749bcb584587416'
AND (
token = 'f/dyzFCIDQig7Rz0Rj+nujHILcKmUH85m3DElfLpaEA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)