UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xGkiEj56a+rM99GVevEo/UWSuFrUnNmE2ipGm4sLGCs='
WHERE
key_id = 'e8a498097109efdd988e7791d4ca649e507b7eb059dc64a15a65cea206e9c424'
AND (
token = 'xGkiEj56a+rM99GVevEo/UWSuFrUnNmE2ipGm4sLGCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)