UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GGsqMMmQjgHXSPFL90R8EaY2zGAeSkSFsV1b51eytzI='
WHERE
key_id = '9937b566ba460d88895b1b070aefebfb7034996b38478efeed964c3251dc4578'
AND (
token = 'GGsqMMmQjgHXSPFL90R8EaY2zGAeSkSFsV1b51eytzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)