UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fXzp7KGCaEXu92xmv3acz/h9zhy4YF0zw/CiYNkfV1I='
WHERE
key_id = 'd1fef6b1e7dd9e2a42d53533c1559806488500ece559456f8a81f555a451b3e0'
AND (
token = 'fXzp7KGCaEXu92xmv3acz/h9zhy4YF0zw/CiYNkfV1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)