UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GoFyuKHk35dmpkhF8FNxyilQ610fYACx7p08BzqStps='
WHERE
key_id = 'e84a5e88c0ba2d787a8d2d5a0956a333b3c5ddc5a77f26644b62454f179e0da9'
AND (
token = 'GoFyuKHk35dmpkhF8FNxyilQ610fYACx7p08BzqStps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)