UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '77Q3R4F4+3oOXQyZLL3Lopb7tenY6S/3BU+ZZPEdzhk=' 
WHERE 
  key_id = '549cbaf7f56c73b0370f5d8483dbf0b22ce4fbcb5dc80cd280b81c50b6cbd7d9' 
  AND (
    token = '77Q3R4F4+3oOXQyZLL3Lopb7tenY6S/3BU+ZZPEdzhk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031