UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c/uWDyRjEzH3i4F/w66yByL2S4cntesAPWIjsLVlv2A=' 
WHERE 
  key_id = '9af15099a45a298947f8a5a9ebfa8b392f2ce2f35f113f03faa2c625364e12a8' 
  AND (
    token = 'c/uWDyRjEzH3i4F/w66yByL2S4cntesAPWIjsLVlv2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039