UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ovEMr2ZC+sXLRlnEW+cuVSZgUbYgygaIn0HsG8E0kDo='
WHERE
key_id = 'f5ef56efdb850c9fbd8eed8d2489e1104a28886128256651d287c081c8881093'
AND (
token = 'ovEMr2ZC+sXLRlnEW+cuVSZgUbYgygaIn0HsG8E0kDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)