UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nQf22vSncRQDABRu9QGnanPbNQGvVIGBJZG/zTo66oQ='
WHERE
key_id = '5abe63603f942a87537cb2f679a25a238253e6c8a51e0143b71f8fdbe7e5c773'
AND (
token = 'nQf22vSncRQDABRu9QGnanPbNQGvVIGBJZG/zTo66oQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)