UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5R2rsdSg9Ffa6prBpN2ZeUlgRXztWU1CI+I73n28tfI='
WHERE
key_id = 'cf1c92eea55c3f2282a76d5ab79c5ee3c295569bffcadfd98a1e67355539c3a6'
AND (
token = '5R2rsdSg9Ffa6prBpN2ZeUlgRXztWU1CI+I73n28tfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)