UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w2lVy/Bt96HA58zEsS5Nw9PxnMg7HbMBIKDhLOacPtA=' 
WHERE 
  key_id = 'a2bf5ef09628cf8033baadde44dc832c33bc6937d1ee53a54fc5f09468c11d93' 
  AND (
    token = 'w2lVy/Bt96HA58zEsS5Nw9PxnMg7HbMBIKDhLOacPtA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027