UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k1OODzuXJVv4pRH37ciLO/K3E7gc7z7s1n54xcdYfOE='
WHERE
key_id = 'e2e487fe160437c09f955642d97e419271977d582e1dcbcc2d2b6278b7d981ee'
AND (
token = 'k1OODzuXJVv4pRH37ciLO/K3E7gc7z7s1n54xcdYfOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)