UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DymbF7JRcwDrWy+5zN7rzJnUA9yCzQUHw610Q9/1nZg=' 
WHERE 
  key_id = 'c94e99b2b2deca8191581fa07542d0a11cf514459b961eb01cc879e089976baa' 
  AND (
    token = 'DymbF7JRcwDrWy+5zN7rzJnUA9yCzQUHw610Q9/1nZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022