UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3RqLEEdGW4FHuoSqAOmONAsw7m0L2CFxez8Pe+Da3SY=' 
WHERE 
  key_id = 'a9010601338b7ddbdd40ef8e0387ef7a729afea45966451ffef8a16f8f420e99' 
  AND (
    token = '3RqLEEdGW4FHuoSqAOmONAsw7m0L2CFxez8Pe+Da3SY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039