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