UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gk38Cjf5Qds15P8Elf6+NotqRxbGn4a6k+i4kKqo+Nc=' 
WHERE 
  key_id = '3240cf2d740611ec45c24deb98607ce7ad090bdf7fe5c86a131717f4c459746b' 
  AND (
    token = 'Gk38Cjf5Qds15P8Elf6+NotqRxbGn4a6k+i4kKqo+Nc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024