UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lff/OXVefJKod0KnvHCwufDz96D4zobHKKQNszitZno='
WHERE
key_id = 'b8610d3aa56c54a36fe89b4b35ac69bc6d6a5e93d31a232d55551b57d8c15d03'
AND (
token = 'Lff/OXVefJKod0KnvHCwufDz96D4zobHKKQNszitZno='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)