UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0P/y8p4pnffwISsLmNQ+Q9KUjlX3tnIh0o6Ug/URHl8=' 
WHERE 
  key_id = '20c8300c72ace4e7bead11f56a25bdda5991214662a8161e94bf384b443f96a0' 
  AND (
    token = '0P/y8p4pnffwISsLmNQ+Q9KUjlX3tnIh0o6Ug/URHl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030