UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bSr3ZiSBDWDv1yotLnOVthoAXqNHbAQLZwi5zhP/N3s='
WHERE
key_id = 'e98fa624767d8f05dbf03fd2fd703773f55e06d953261ccf78f7023cce177db6'
AND (
token = 'bSr3ZiSBDWDv1yotLnOVthoAXqNHbAQLZwi5zhP/N3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)