UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '60hhQgzEVXYqsOFECdEGWDwxz20hP8vTRpY7uMSCZcs='
WHERE
key_id = '59308fd4808ae42598a50662907fa706d378ea0a47d3a2a8c28d3a617a0997f8'
AND (
token = '60hhQgzEVXYqsOFECdEGWDwxz20hP8vTRpY7uMSCZcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)