UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '17ruOqXaSWFW0dxs0ZqJG/E/AXfFd7Nj2VYwId3LfQ0='
WHERE
key_id = '1b275daa60b1cd7e333b53714e172da6383cc4954c74b0853a6b8e48a040e186'
AND (
token = '17ruOqXaSWFW0dxs0ZqJG/E/AXfFd7Nj2VYwId3LfQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)