UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wj9/rMgSIgm534brp0NkaPz1x2AentkHY7B/+B/IGlg='
WHERE
key_id = 'cf2ccc4abb40cd6c07091694d6b8a4974a18ee791e4025d68bbeec8264df2a62'
AND (
token = 'Wj9/rMgSIgm534brp0NkaPz1x2AentkHY7B/+B/IGlg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)