UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GW17/0aDt/tRC5jXoo7Qpa7U7Xv5WPt04NXgGKrNsLU=' 
WHERE 
  key_id = '9d5d947ea1b2a32b81170b2693a1b0d94ac8708051accaf6010b048a2ab3ca78' 
  AND (
    token = 'GW17/0aDt/tRC5jXoo7Qpa7U7Xv5WPt04NXgGKrNsLU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044